# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer:
pkgname=spotify-qt
pkgver=3.8
pkgrel=0
pkgdesc="Lightweight Spotify client using Qt"
url="https://github.com/kraxarn/spotify-qt"
arch="all"
license="GPL-3.0-or-later"
makedepends="cmake samurai qt5-qtbase-dev qt5-qtsvg-dev"
source="https://github.com/kraxarn/spotify-qt/archive/v$pkgver/spotify-qt-$pkgver.tar.gz
	disable-crash-handler.patch
	"
options="!check"  # no tests provided

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -G Ninja -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_VERBOSE_MAKEFILE=True \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
0c93ad31326d8e13315e9f2baf7342ea9161cd6609de839dae2edf2d1fdf8151d990ff1ec1a0fab9e3e9f8d7bdf1d92d7cb49a6516f8d7c73690c73fecee9a67  spotify-qt-3.8.tar.gz
2e9db2682da53be224f1bc4cb5c6c6eb54f32ba53e93a774af16e114fcbe81a0528a254c57955c97ee73f2fe3df9b04f5bce4f88e03e4e82282bb85c65f14f13  disable-crash-handler.patch
"
